<script language = "Javascript">	
	$(document).ready(function() {
		$('#yt1').click(function(){
			var  received_time = document.getElementById('Job_received_time');
			if(received_time.value == "")
			{
				alert('Ngày không được bỏ trống');
				received_time.focus();
				return false;
			}
			else if(isDate(received_time.value)==false)
			{
				received_time.focus()
				return false
			}
			return true;
		})
		
		$('#yt0').click(function(){
			var  received_time = document.getElementById('Job_received_time');
			if(received_time.value == "")
			{
				alert('Ngày không được bỏ trống');
				received_time.focus();
				return false;
			}
			else if(isDate(received_time.value)==false)
			{
				received_time.focus()
				return false
			}
			return true;
		})
	});
</script>
<div class="wide form">
<?php $form=$this->beginWidget('CActiveForm', array(	
        'action'=>Yii::app()->createUrl($this->route),
	'id'=>'report-form',
	'enableAjaxValidation'=>true,
	'method' => 'get' ,
)); ?>
	<div id="condition">
		<div class="row">
			<?php echo Chtml::label('Ngày tiếp nhận',false) ?>
			<?php //echo $form->textField($model,'date1');
				if(isset($model->received_time))
				{
					$model->received_time =  date("d-m-Y" , strtotime($model->received_time));
				}
			?>
			<?php
				$form->widget('zii.widgets.jui.CJuiDatePicker', array(
					'name'=>CHtml::activeName($model,'received_time'),   
					'model'=>$model,
					'attribute'=>'received_time',
					'options' => array(
						'dateFormat' => 'dd-mm-yy',
						'showAnim'   => 'fold',
						'showOn'     =>'button',
						'buttonText' =>Yii::t('ui','Select form calendar'),
						'buttonImage'=>Yii::app()->request->baseUrl.'/images/calendar.png',
						'buttonImageOnly'=>true,						
					),
					'htmlOptions'=>array(
						'style'=>'width:80px;vertical-align:top;'
					),
				));
			?>
		</div>		
	</div>
	<div id="statistics">
		<div class="buttons report">
		<?php echo CHtml::submitButton('Xem trực tiếp' , array('submit'=>array('job/reportSubmit'))); ?>
		
		<?php echo CHtml::submitButton('Xuất excel' , array('submit'=>array('job/reportExcel'))); ?>		
		</div>
	</div>
	
<?php $this->endWidget(); ?>
</div><!-- search-form -->
